<template>
    <div>
        <!-- 班次调度-班次日计划 -->
        <el-row>
            <el-col :span="24">
                <div class="container">
                    <!-- 日期选择 -->
                    <el-row class="date-container">
                        <el-col :span="24">
                            <el-form ref="form" label-width="80px">
                                <el-form-item label="班次日期">
                                    <el-date-picker type="date" placeholder="" v-model="classDate" style="width: 150px"
                                                    size="mini"></el-date-picker>
                                </el-form-item>
                            </el-form>
                        </el-col>
                    </el-row>
                    <!-- 详细条件选择 -->
                    <el-row class="detail-container">
                        <el-col :span="24">
                            <div class="lf choose-title">线路</div>
                            <el-autocomplete v-model="road" placeholder="" size="mini" style="width:150px;"
                                             class="lf choose-input" :fetch-suggestions="querySearch"></el-autocomplete>
                            <div class="lf choose-title choose-input">到站</div>
                            <el-autocomplete v-model="toPlace" placeholder="" size="mini" style="width:150px;"
                                             class="lf choose-input"
                                             :fetch-suggestions="querySearchEnd"></el-autocomplete>
                            <div class="choose-title lf choose-input">时间</div>
                            <el-time-picker
                                    is-range
                                    v-model="dateFrom"
                                    range-separator="至"
                                    start-placeholder="开始时间"
                                    end-placeholder="结束时间"
                                    placeholder="选择时间范围" size="mini">
                            </el-time-picker>
<!--
                            <el-date-picker type="date" v-model="dateFrom" style="width: 150px;" size="mini"
                                            class="lf choose-input"></el-date-picker>
                             <div class="lf choose-title choose-input">至</div>
                            <el-date-picker type="date" v-model="dateTo" style="width: 150px;" size="mini"
                                            class="lf"></el-date-picker>-->
                            <el-radio-group v-model="checkChoose" class="check-container">
                                <el-radio :label="1">全部</el-radio>
                                <el-radio :label="2">售票</el-radio>
                                <el-radio :label="3">报班</el-radio>
                                <el-radio :label="4">停班</el-radio>
                                <el-radio :label="5">发班</el-radio>
                            </el-radio-group>
                        </el-col>
                    </el-row>
                    <el-row class="detail-container d2">
                        <el-col :span="24">
                            <div class="lf choose-title">加班</div>
                            <DropDown :cv="chooseValue" :ci="chooseItem" :wt="jiaBanWt"></DropDown>
                            <div class="lf choose-title">班次号</div>
                            <el-input v-model="classNum" placeholder="" size="mini" style="width:150px;"
                                      class="lf choose-input"></el-input>
                            <button class="check-btn rf" @click="reset"><img
                                    src="../../assets/imgs/operation_btn_icon_chongzhi_default.png" alt=""
                                    class="btn-img">
                                重置
                            </button>
                            <button class="check-btn rf" @click="check"><img
                                    src="../../assets/imgs/xoperation_btn_icon_saixuan_default.png" alt=""
                                    class="btn-img">
                                筛选
                            </button>
                        </el-col>
                    </el-row>
                    <!-- 表格菜单栏 -->
                    <el-row>
                        <el-col :span="24" class="table-fun">
                            <img src="../../assets/imgs/operation_icon_shuaxin_default.png" alt="" class="lf">
                            <div class="lf choose-title fun-text" @click="allList">刷新</div>
                            <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt="" class="lf">
                            <div class="lf choose-title fun-text" @click="addClass">添加</div>
                            <img src="../../assets/imgs/operation_icon_xiugai_default.png" alt="" class="lf">
                            <div class="lf choose-title fun-text" @click="showUpdateWin">修改</div>
                            <img src="../../assets/imgs/operation_icon_shanchu_default.png" alt="" class="lf">
                            <div class="lf choose-title fun-text" @click="deleteClass">删除</div>
                            <img src="../../assets/imgs/operation_icon_dayin_default.png" alt="" class="lf">
                            <div class="lf choose-title fun-text">打印空白座位表</div>
                        </el-col>
                    </el-row>
                    <!-- 表格栏 -->
                    <el-row>
                        <el-col :span="24" class="seatWid">
                            <avue-crud :page="carTable[0].page" :data="carTable[0].data" :option="carTable[0].option"
                                       @current-row-change="rowChange" @current-change="currentChange">
                                <template slot-scope="props" slot="expand">
                                    <div class="table-fun">
                                        <img src="../../assets/imgs/operation_icon_fuzhi_default.png" alt="" class="lf">
                                        <div class="lf choose-title fun-text" @click="copyClass(props.row)">复制班次</div>
                                        <img src="../../assets/imgs/operation_icon_piaojia_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="TicTableMsg">票价</div>
                                        <img src="../../assets/imgs/operation_icon_banci_default.png" alt="" class="lf">
                                        <div class="lf choose-title fun-text" @click="peiKeTableMsg">配客</div>
                                        <img src="../../assets/imgs/operation_icon_mingxi_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="showSeatDetail">座位明细</div>
                                    </div>
                                </template>
                            </avue-crud>

                            <div v-if="seatMess" class="seatMess-show">
                                <span @click="showSeatFun" style="cursor:pointer;width: 30px;height: 30px;position: absolute;left: 2px;top: 10px;">《</span>
                            </div>
                            <div class="seatMess-box" v-if="hideSeatMess" ><!-- v-if="seatMess"-->

                                <div class="seatMess-txt">
                                    座位售票信息
                                    <span @click="hideSeat" style="cursor:pointer;text-align:center;width: 30px;height: 30px;position: absolute;right: 0;">》</span>
                                </div>
                                <ul></ul>
                            </div>

                        </el-col>
                    </el-row>
                </div>
            </el-col>
        </el-row>
        <!-- 添加班次弹窗 -->
        <div class="modal-win" v-show="addWin">
            <div class="add-container">
                <div class="closeWin" @click="redClass">X</div>
                <!-- 标题栏 -->
                <el-row class="add-title">
                    <el-col :span="24">
                        <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span class="add-text">{{modTitle}}</span>
                    </el-col>
                </el-row>
                <!-- 功能栏 -->
                <el-row>
                    <el-col :span="24">
                        <el-tabs v-model="addFunTab" type="card" class="fun-tab" @tab-click="handleClick">
                            <el-tab-pane label="基础资料" name="msg">
                                <el-row>
                                    <el-col :span="24">
                                        <!-- 左侧信息栏 -->
                                        <div class="left-msg">
                                            <div class="msg-row" v-show="modTitle=='添加班次'">
                                                <div class="lf choose-title">班次日期<span style="color: #FF4E4E;">*</span></div>
                                                <el-date-picker type="date" v-model="addClassDate" style="width: 130px;"
                                                                size="mini" class="lf choose-input"></el-date-picker>
                                                <div class="lf choose-title">&nbsp; 至&nbsp;</div>
                                                <el-date-picker type="date" v-model="addClassDateTo"
                                                                style="width: 130px;" size="mini"></el-date-picker>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">线路<span style="color: #FF4E4E;">*</span></div>
                                                <el-autocomplete v-model="addRoad" placeholder="" size="mini" style="width:415px;margin-left:28px;"
                                                                 class="lf choose-input" :fetch-suggestions="querySearch1"></el-autocomplete>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">班次号<span style="color: #FF4E4E;">*</span></div>
                                                <el-input v-model="addClassNum" size="mini"
                                                          style="width:140px;margin-left:14px"
                                                          class="choose-input lf"></el-input>
                                                <el-time-picker class="rf" v-model="addCarTime" placeholder="任意时间点"></el-time-picker>
                                                <div class="rf choose-title">发车时间<span style="color: #FF4E4E;">*</span></div>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">座位数<span style="color: #FF4E4E;">*</span></div>
                                                <el-input v-model="addSeatCount" size="mini"
                                                          style="width:140px;margin-left:14px"
                                                          class="choose-input lf"></el-input>
                                                <el-autocomplete v-model="addCarId" placeholder="" size="mini" style="width:140px;margin-left:14px;"
                                                                 class="rf choose-input" :fetch-suggestions="querySearch2"></el-autocomplete>
                                                <div class="rf choose-title">车牌号码</div>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">运营单位</div>
                                                <el-autocomplete v-model="addComp" placeholder="" size="mini" style="width:420px;"
                                                                 class="rf choose-input" :fetch-suggestions="querySearch3"></el-autocomplete>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">车型</div>
                                                <el-select v-model="addCarType" placeholder="请选择" size="mini"
                                                           style="width:140px;margin-left:28px" class="lf choose-input">
                                                    <el-option
                                                            v-for="item in carList"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                    </el-option>
                                                </el-select>
                                                <el-select v-model="addCompII" placeholder="请选择" size="mini"
                                                           style="width:140px;margin-left:18px" class="rf choose-input">
                                                    <el-option
                                                            v-for="item in addCompList"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                    </el-option>
                                                </el-select>
                                                <div class="rf choose-title">运营方式<span style="color: #FF4E4E;">*</span></div>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">座位类型<span style="color: #FF4E4E;">*</span></div>
                                                <el-select v-model="addSeatType" placeholder="请选择" size="mini"
                                                           style="width:140px;" class="lf choose-input">
                                                    <el-option
                                                            v-for="item in seatTypeList"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                    </el-option>
                                                </el-select>
                                                <el-select v-model="ClassType" placeholder="请选择" size="mini"
                                                           style="width:140px;margin-left:18px;"
                                                           class="rf choose-input">
                                                    <el-option
                                                            v-for="item in classTypeList"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                    </el-option>
                                                </el-select>
                                                <div class="rf choose-title">班次类型<span style="color: #FF4E4E;">*</span></div>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">提前预售<span style="color: #FF4E4E;">*</span></div>
                                                <el-input v-model="beforeSell" size="mini" style="width:110px;"
                                                          class="choose-input lf"></el-input>
                                                <div class="lf choose-title">天</div>
                                                <el-input v-model="checkDoor" style="width: 140px;margin-left:28px"
                                                          size="mini" class="rf choose-input"></el-input>
                                                <div class="rf choose-title">检票门</div>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">终点站</div>
                                                <el-input v-model="endStation" size="mini"
                                                          style="width:140px;margin-left:14px"
                                                          class="choose-input lf"></el-input>
                                                <el-input v-model="startPlace" style="width: 140px;margin-left:28px"
                                                          size="mini" class="rf choose-input"></el-input>
                                                <div class="rf choose-title">发车卡位</div>
                                                <div class="cb"></div>
                                            </div>
                                            <div class="msg-row">
                                                <div class="lf choose-title">备注</div>
                                                <el-input v-model="beiZhu" size="mini"
                                                          style="width:420px;margin-left:28px" class="choose-input lf"
                                                          type="textarea"></el-input>
                                                <div class="cb"></div>
                                            </div>
                                            <!-- 选框 -->
                                            <el-checkbox v-model="checkStart">启用</el-checkbox>
                                            <el-checkbox v-model="checkPei">配客</el-checkbox>
                                            <el-checkbox v-model="checkAllow">允许远程售票</el-checkbox>
                                            <el-checkbox v-model="checkAddClass">加班</el-checkbox>
                                            <br>
                                            <el-checkbox v-model="checkCarTime">打印发车时间</el-checkbox>
                                            <el-checkbox v-model="checkPintSeat">打印座位号</el-checkbox>
                                            <el-checkbox v-model="checkClassNum">打印班次号</el-checkbox>
                                        </div>
                                        <!-- 右侧图 -->
                                        <div class="right-img">
                                            <div class="ticDataRight-bottom">
                                                <ul>
                                                    <li title="可售">
                                                        <i></i>
                                                        <span>可售</span>
                                                    </li>
                                                    <li title="已售">
                                                        <i class="right-icon1"></i>
                                                        <span>已售</span>
                                                    </li>
                                                    <li title="停售">
                                                         <i class="right-icon2"></i>
                                                        <span>停售</span>
                                                    </li>
                                                    <li title="留位">
                                                         <i class="right-icon3"></i>
                                                        <span>留位</span>
                                                    </li>
                                                    <li title="配客">
                                                         <i class="right-icon5"></i>
                                                        <span>配客</span>
                                                    </li>
                                                    <li title="预定">
                                                         <i class="right-icon6"></i>
                                                        <span>预定</span>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="seat-icon">
                                                <ul>
                                                    <li class="seat-icon1">1</li>
                                                    <li class="seat-icon1 active-seat">2</li>
                                                    <li class="seat-icon1">3</li>
                                                    <li class="seat-icon1">4</li>
                                                    <li class="seat-icon1">5</li>
                                                    <li class="seat-icon1 active-seat">6</li>
                                                    <li class="seat-icon1">7</li>
                                                    <li class="seat-icon1">8</li>
                                                    <li class="seat-icon1">9</li>
                                                    <li class="seat-icon1 active-seat">10</li>
                                                    <li class="seat-icon1">11</li>
                                                    <li class="seat-icon1">12</li>
                                                    <li class="seat-icon1">13</li>
                                                    <li class="seat-icon1 active-seat">14</li>
                                                    <li class="seat-icon1">15</li>
                                                    <li class="seat-icon1">16</li>
                                                    <li class="seat-icon1">17</li>
                                                    <li class="seat-icon1 active-seat">18</li>
                                                    <li class="seat-icon1">19</li>
                                                    <li class="seat-icon1">20</li>
                                                    <li class="seat-icon1">21</li>
                                                    <li class="seat-icon1 active-seat">22</li>
                                                    <li class="seat-icon1">23</li>
                                                    <li class="seat-icon1">24</li>
                                                    <li class="seat-icon1">25</li>
                                                    <li class="seat-icon1 active-seat">26</li>
                                                    <li class="seat-icon1">27</li>
                                                    <li class="seat-icon1">28</li>
                                                    <li class="seat-icon1">29</li>
                                                    <li class="seat-icon1 active-seat">30</li>
                                                    <li class="seat-icon1">31</li>
                                                    <li class="seat-icon1">32</li>
                                                    <li class="seat-icon1">33</li>
                                                    <li class="seat-icon1 active-seat">34</li>
                                                    <li class="seat-icon1">35</li>
                                                    <li class="seat-icon1">36</li>
                                                    <li class="seat-icon1">37</li>
                                                    <li class="seat-icon1 active-seat">38</li>
                                                    <li class="seat-icon1">39</li>
                                                    <li class="seat-icon1">40</li>
                                                    <li class="seat-icon1">41</li>
                                                    <li class="seat-icon1 active-seat">42</li>
                                                    <li class="seat-icon1">43</li>
                                                    <li class="seat-icon1">44</li>
                                                    <li class="seat-icon1">45</li>
                                                    <li class="seat-icon1 active-seat">46</li>
                                                    <li class="seat-icon1">47</li>
                                                </ul>
                                            </div>
                                        </div>
                                        <button class="check-btn rf" @click="redClass">
                                            <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt=""
                                                 class="btn-img">
                                            取消
                                        </button>
                                        <button class="check-btn rf" @click="saveClass"><img
                                                src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt=""
                                                class="btn-img">
                                            保存
                                        </button>
                                    </el-col>
                                </el-row>

                            </el-tab-pane>
                            <el-tab-pane label="票价" name="price">
                                <el-row>
                                    <el-col :span="24" class="table-fun">
                                        <img src="../../assets/imgs/operation_icon_shuaxin_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="getModList">刷新</div>
                                        <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="TicAdd">添加</div>
                                        <img src="../../assets/imgs/operation_icon_xiugai_default.png" alt=""
                                             class="lf">
                                        <!--<div class="lf choose-title fun-text">修改</div>-->
                                        <img src="../../assets/imgs/operation_icon_shanchu_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="TicDel">删除</div>
                                        <img src="../../assets/imgs/operation_icon_banci_default.png" alt="" class="lf">
                                        <div class="lf choose-title fun-text" @click="TicUpdate">更新到同路线的所有班次</div>
                                        <div class="rf">
                                            <el-form ref="form" label-width="80px">
                                                <el-form-item label="">
                                                    <el-select v-model="region" placeholder="">
                                                        <el-option label="本站票价" value="bus_plan"></el-option>
                                                        <el-option label="本站及配客站票价" value="bus_plan_via"></el-option>
                                                    </el-select>
                                                </el-form-item>
                                            </el-form>
                                        </div>
                                    </el-col>
                                   <!-- <TableData :data="modList.data" :option="modList.option" :rowChange="modrowChange"
                                               class="mod-table"></TableData>-->
                                    <el-table :data="tableData5" style="width: 100%">
                                        <el-table-column type="expand">
                                            <template slot-scope="props">
                                                <el-form label-position="left" inline class="demo-table-expand">
                                                    <div class="expand-box">
                                                        <!--左边数据 S-->
                                                        <div class="expandLeft lf">
                                                            <avue-form  size="mini" ref="form" v-model="expandModel" :data="expandData" :option="expandOption" class="yz-form"></avue-form>
                                                        </div>
                                                        <!--左边数据 E-->

                                                        <!--右边数据 S-->
                                                        <div class="expandRight lf">
                                                            <el-form ref="form">
                                                                <el-form-item v-for="(item,index) in expandArr" :label="item.name" label-width="70px" class="lf">
                                                                    <el-input v-model="one['type_' + expandArr[index].id]" style='width: 160px;' size="mini"></el-input>
                                                                </el-form-item>
                                                            </el-form>
                                                        </div>
                                                        <!--右边数据 E-->
                                                        <button @click="saveData" type="button" class="save-expand lf"><i></i>保存</button>
                                                    </div>
                                                </el-form>
                                            </template>
                                        </el-table-column>
                                        <el-table-column label="" prop="is_valid"></el-table-column>
                                        <el-table-column label="站点名" prop="st_name"></el-table-column>
                                        <el-table-column v-for="(item,index) in expandArr" :label="item.name" :prop="'type_' + expandArr[index].id"></el-table-column>
                                        <el-table-column label="" prop="title"></el-table-column>
                                        <!--<el-table-column label="" prop="is_valid"></el-table-column>  'type_' expandArr[index].id
                                        <el-table-column label="站点名" prop="st_name"></el-table-column>
                                        <el-table-column label="全票" prop="type_1"></el-table-column>
                                        <el-table-column label="半票" prop="type_2"></el-table-column>
                                        <el-table-column label="学生票" prop="type_3"></el-table-column>
                                        <el-table-column label="老人票" prop="type_4"></el-table-column>
                                        <el-table-column label="军残票" prop="type_5"></el-table-column>
                                        <el-table-column label="回程票" prop="type_6"></el-table-column>
                                        <el-table-column label="双程票" prop="type_7"></el-table-column>
                                        <el-table-column label="员工票" prop="type_8"></el-table-column>
                                        <el-table-column label="优惠票" prop="type_9"></el-table-column>
                                        <el-table-column label="内部票" prop="type_10"></el-table-column>
                                        <el-table-column label="春运票" prop="type_11"></el-table-column>
                                        <el-table-column label="景点套餐" prop="type_12"></el-table-column>
                                        <el-table-column label="优惠票往返" prop="type_13"></el-table-column>
                                        <el-table-column label="上限价" prop="max_price"></el-table-column>
                                        <el-table-column label="附加费" prop="surcharges"></el-table-column>
                                        <el-table-column label="" prop="title"></el-table-column>-->
                                    </el-table>

                                </el-row>
                            </el-tab-pane>
                            <el-tab-pane label="配客" name="seat">
                                <el-row class="peiKe-fun">
                                    <el-col :span="24">
                                        <div class="lf choose-title">配客车站</div>
                                        <el-select v-model="peiKeSta" placeholder="请选择" size="mini" style="width:120px"
                                                   class="lf choose-input">
                                            <el-option
                                                    v-for="item in peiKeList"
                                                    :key="item.value"
                                                    :label="item.label"
                                                    :value="item.label">
                                            </el-option>
                                        </el-select>
                                        <button class="check-btn rf" @click="saveSta"><img src="../../assets/imgs/xoperation_btn_icon_saixuan_default.png" alt="" class="btn-img">保存</button>
                                        <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt=""
                                             class="lf peike-img">
                                        <div class="lf choose-title fun-text" @click="addPei">添加</div>
                                        <div class="rf choose-title fun-text" @click="TicTongbu">复制数据设置到同线路所有班次</div>
                                        <img src="../../assets/imgs/operation_icon_shengcheng_default.png" alt=""
                                             class="rf peike-img">
                                    </el-col>
                                </el-row>
                                <!-- 配客信息栏 -->
                                <el-row>
                                    <el-col :span="24">
                                        <div class="peiKe-container" v-for="(item,i) of peiKeMsg">
                                            <div class="lf pk-num">{{i+1}}</div>
                                            <div class="lf pk-num">{{item.org_name}}</div>
                                            <div class="lf choose-title pk-text">发车时间：{{item.bus_time}}</div>
                                            <div class="lf choose-title pk-text">班次号：{{item.bus_id}}</div>
                                            <div class="rf pk-main">主</div>
                                            <div class="cb"></div>
                                        </div>
                                    </el-col>
                                </el-row>
                            </el-tab-pane>
                        </el-tabs>
                    </el-col>
                </el-row>
            </div>

        </div>

        <!-- 座位明细弹窗 -->
        <div class="modal-win" v-show="seatShow">
            <div class="add-container">
                <div class="closeWin" @click="redSeat">X</div>
                <!-- 标题栏 -->
                <el-row class="add-title">
                    <el-col :span="24">
                        <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span
                            class="add-text">座位明细</span>
                    </el-col>
                </el-row>
                <!-- 座位表格栏 -->
                <el-row>
                    <el-col :span="24" style="height: 600px;overflow: hidden;overflow-y: scroll;">
                        <avue-crud ref="crud" :data="accountData" :option="accountOption"></avue-crud>
                    </el-col>
                    <div>可售：<span>{{this.endSeat}}</span></div>
                </el-row>
            </div>
        </div>
        <!-- 右键菜单 -->
        <div class="right-menu">
            <ul>
                <li>{{rightLineName}}</li>
                <li @click="desClass">销班</li>
                <li @click="openRightStop">停班</li>
                <li @click="openRightStart">开班</li>
                <li @click="openRightSum">合并至...</li>
                <li>复制票价</li>
                <li class="rightTwo">复制此班次
                    <span class="el-icon-caret-right rf"></span>
                </li>
                <li @click="openRightCopy">复制次班次详细信息</li>
                <li>打印座位明细表</li>
                <li>写入发班信息</li>
                <li>预售期设置</li>
            </ul>
            <!-- 二级右击菜单 -->
            <div class="right-menuII">
                <div class="rightII-text" @click="openCopy1">到当天同路线班次</div>
                <div class="rightII-text" @click="openCopy2">到当天及以后日期同线路班次</div>
            </div>
        </div>
        <!-- 右键弹窗 -->
        <!-- 右键开班 -->
        <div class="right-modal-win" v-show="rightStartWin">
            <div class="closeWin" @click="closeRight">X</div>
            <!-- 标题栏 -->
            <el-row class="add-title">
                <el-col :span="24">
                    <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span class="add-text">开班[{{currentMsg.bus_id}}][{{currentMsg.bus_date}}]</span>
                </el-col>
            </el-row>
            <!-- 表单栏 -->
            <el-row>
                <el-col :span="24">
                    <avue-form v-model="rStart" :option="rStartForm" class="yz-form start-from"></avue-form>
                </el-col>
            </el-row>
            <el-row class="start-btn">
                <el-col :span="24">
                    <button class="check-btn rf" @click="closeRight">
                        <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
                    </button>
                    <button class="check-btn rf" @click="rStartClass"><img
                            src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
                    </button>
                </el-col>
            </el-row>
        </div>
        <!-- 右键停班 -->
        <div class="right-Stopmodal-win" v-show="rightStopWin">
            <div class="closeWin" @click="closeStop">X</div>
            <!-- 标题栏 -->
            <el-row class="add-title">
                <el-col :span="24">
                    <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span class="add-text">停班[{{currentMsg.bus_id}}][{{currentMsg.bus_date}}]</span>
                </el-col>
            </el-row>
            <!-- 表单栏 -->
            <el-row>
                <el-col :span="24">
                    <avue-form v-model="rStop" :option="rStopForm" class="yz-form start-from"></avue-form>
                </el-col>
            </el-row>
            <el-row class="start-btn">
                <el-col :span="24">
                    <button class="check-btn rf" @click="closeStop">
                        <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
                    </button>
                    <button class="check-btn rf" @click="rStopClass"><img
                            src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
                    </button>
                </el-col>
            </el-row>
        </div>
        <!-- 右键并班 -->
        <div class="right-Summodal-win" v-show="rightSumWin">
            <div class="closeWin" @click="closeSum">X</div>
            <!-- 标题栏 -->
            <el-row class="add-title">
                <el-col :span="24">
                    <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span class="add-text">并班</span>
                </el-col>
            </el-row>
            <!-- 数据栏 -->
            <el-row>
                <!-- 左侧 -->
                <el-col :span="8" class="sum-left">
                    <div>将[{{currentMsg.bus_date}}] 班次 [{{currentMsg.bus_id}}]</div>
                    <div class="sum-msg-container">
                        <ul class="sum-ul">
                            <li v-for="(item,i) of currentMsg.seatcount">{{i+1}}</li>
                        </ul>
                    </div>
                </el-col>
                <!-- 中间 -->
                <el-col :span="8" class="sum-left">
                    <div>并入到 [{{this.sumDate}}] 班次 [{{this.sumID}}]</div>
                    <div class="sum-msg-container">
                        <avue-crud :data="sumList.data" :option="sumList.option"
                                   @current-row-change="rSumCurrentRow"></avue-crud>
                    </div>
                </el-col>
                <!-- 右侧 -->
                <el-col :span="8" class="sum-left">
                    <div>座位表</div>
                    <div class="sum-msg-container">
                        <ul class="sum-ul">
                            <li v-for="(item,i) of sumMsg.seatcount">{{i+1}}</li>
                        </ul>
                    </div>
                </el-col>
            </el-row>
            <!-- 备注栏 -->
            <el-row>
                <el-col :span="24">
                    <avue-form v-model="sumBei" :option="sumBeiOption" class="yz-form"></avue-form>
                </el-col>
            </el-row>
            <!-- 按钮 -->
            <el-row class="start-btn">
                <el-col :span="24">
                    <button class="check-btn rf" @click="closeSum">
                        <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
                    </button>
                    <button class="check-btn rf" @click="rSum"><img
                            src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">合并
                    </button>
                </el-col>
            </el-row>
        </div>
        <!-- 右键复制1 -->
        <div class="right-copymodal-win" v-show="rightCopywin1">
            <!-- 标题栏 -->
            <el-row class="add-title">
                <el-col :span="24">
                    <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span
                        class="add-text">复制班次票价计划</span>
                </el-col>
            </el-row>
            <!-- 信息栏 -->
            <el-row class="copy-msg">
                <el-col :span="24" class="choose-title copy-title">是否确认将此班次的票价复制到当天同路线先其他班次?</el-col>
            </el-row>
            <!-- 勾选框 -->
            <el-row class="copy-msg">
                <el-col :span="24">
                    <el-checkbox v-model="copyCheck">维持目标班次原票价状态</el-checkbox>
                </el-col>
            </el-row>
            <!-- 按钮 -->
            <el-row class="start-btn">
                <el-col :span="24">
                    <button class="check-btn rf" @click="copyConfirm">确定</button>
                    <button class="check-btn rf copy-btn" @click="discopy">取消</button>
                </el-col>
            </el-row>
        </div>
        <!-- 右键复制2 -->
        <div class="right-copymodal-win" v-show="rightCopywin2">
            <!-- 标题栏 -->
            <el-row class="add-title">
                <el-col :span="24">
                    <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span
                        class="add-text">复制班次票价计划</span>
                </el-col>
            </el-row>
            <!-- 信息栏 -->
            <el-row class="copy-msg">
                <el-col :span="24" class="choose-title copy-title">是否确认将此班次的票价复制到当天及以后日期同路线下其他班次?</el-col>
            </el-row>
            <!-- 勾选框 -->
            <el-row class="copy-msg">
                <el-col :span="24">
                    <el-checkbox v-model="copyCheck">维持目标班次原票价状态</el-checkbox>
                </el-col>
            </el-row>
            <!-- 按钮 -->
            <el-row class="start-btn">
                <el-col :span="24">
                    <button class="check-btn rf" @click="copyConfirm2">确定</button>
                    <button class="check-btn rf copy-btn" @click="discopy2">取消</button>
                </el-col>
            </el-row>
        </div>
        <!-- 复制班次详细信息 -->
        <div class="right-copyAllmodal-win" v-show="rightCopyAll">
            <div class="closeWin" @click="closeCopy">X</div>
            <!-- 标题栏 -->
            <el-row class="add-title">
                <el-col :span="24">
                    <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span class="add-text">复制班次详细信息 [{{currentRow}}][{{currentMsg.bus_date}}][{{currentMsg.bus_time}}]</span>
                </el-col>
            </el-row>
            <el-row class="copy-text">
                <el-col :span="24">
                    <div>目标班次</div>
                </el-col>
            </el-row>
            <!-- 表单栏 -->
            <el-row class="copyAll-form">
                <el-col :span="24">
                    <avue-form ref="form" v-model="copyForm" :option="copyListOption"
                               class="yz-form copy-form"></avue-form>
                    <!-- 按钮 -->
                    <button class="check-btn rf copyAll-btn" @click="docopyCheck">
                        <img src="../../assets/imgs/operation_btn_icon_chaxun_default.png" alt="" class="btn-img">查询
                    </button>
                </el-col>
            </el-row>
            <!-- 表格栏 -->
            <el-row class="copy-table">
                <el-col :span="24" class="copy-tableMsg">
                    <avue-crud :data="copyList.data" :option="copyList.option"></avue-crud>
                </el-col>
                <div class="cb"></div>
            </el-row>
            <!-- 复制信息 -->
            <el-row class="copy-text">
                <el-col :span="24">复制信息</el-col>
            </el-row>
            <!-- 复选框栏 -->
            <avue-form ref="form" v-model="copyCheck" :option="copyCheckListOption" class="yz-form"></avue-form>
            <!-- 按钮 -->
            <el-row class="start-btn">
                <el-col :span="24">
                    <button class="check-btn rf" @click="closeCopyDetail">
                        <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
                    </button>
                    <button class="check-btn rf" @click="rCopyDetail"><img
                            src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
                    </button>
                </el-col>
            </el-row>
        </div>

        <!--修改班次  添加弹窗 S-->
        <div class="addModel" v-if="addModels">
            <div class="expand-box">
                <!--左边数据 S-->
                <div class="expandLeft lf">
                    <avue-form  size="mini" ref="form" v-model="expandModel1" :data="expandData1" :option="expandOption1" class="yz-form"></avue-form>
                </div>
                <!--左边数据 E-->

                <!--右边数据 S-->
                 <div class="expandRight lf">
                     <el-form ref="form">
                         <el-form-item v-for="(item,index) in expandArr" :label="item.name" label-width="70px" class="lf">
                             <el-input v-model="one['type_' + expandArr[index].id]" style='width: 160px;' size="mini"></el-input>
                         </el-form-item>
                     </el-form>
                     <!--<avue-form  size="mini" ref="form" v-model="expandModel2" :data="expandData2" :option="expandOption2" class="yz-form"></avue-form>-->
                 </div>
                <!--右边数据 E-->
                <button @click="saveExpand" type="button" class="save-expand lf"><i></i>保存</button>
                <button @click="cancleExpand" type="button" class="save-expand cancle-expand lf"><i></i>取消</button>
            </div>
        </div>
        <!--修改班次  添加弹窗 E-->
    </div>
</template>

<script>
    import "../../assets/js/jquery.js";
    import qs from "qs";
    import DropDown from "../../components/common/dropdown"
    import TableData from "../../components/common/tableData";
    import FormData from "../../components/common/form"
    import "../../assets/js/mouse.js"

    var dd = new Date;
    const DIC = {
        openType: [
            {
                label: "当班",
                value: "1"
            },
            {
                label: "全部",
                value: "2"
            },
            {
                label: "按日期",
                value: "3"
            },
        ],
        tongBuSetting: [
            {
                label: "同步",
                value: "1"
            },
        ],
        longS: [
            {
                label: "",
                value: "1"
            }
        ],
        TongS: [
            {
                label: "",
                value: "1"
            }
        ],
        copyCheckList1: [
            {
                label: "座位",
                value: "seat"
            },
            {
                label: "票价",
                value: "price"
            },
            {
                label: "车牌",
                value: "vecho"
            },
            {
                label: "营运单位",
                value: "comp"
            },
            {
                label: "班车车型",
                value: "carStyle"
            },
            {
                label: "班次状态",
                value: "classState"
            },
            {
                label: "班次类型",
                value: "classStyle"
            },
            {
                label: "预售天数",
                value: "sellDay"
            },
            {
                label: "检票门",
                value: "checkDoor"
            },

        ],
        copyCheckList2: [
            {
                label: "发车卡位",
                value: "seat"
            },
            {
                label: "是否配套",
                value: "suitable"
            },
            {
                label: "是否启用",
                value: "startable"
            },
            {
                label: "是否加班",
                value: "isAdd"
            },
            {
                label: "允许远程售票",
                value: "sellFar"
            },
            {
                label: "终点站",
                value: "end"
            },
            {
                label: "打印班次时间",
                value: "printTime"
            },
            {
                label: "打印班次号",
                value: "printID"
            },
            {
                label: "打印座位号",
                value: "printSeat"
            },
        ],
        qiYong:[
            {
                label: '是',
                value: true,
            }, {
                label: '否',
                value: false,
            }
        ]
    };
    export default {
        data: function () {
            return {
                one: { },
                region:'',
                expandIndex:'',
                addModels:false,
                // addModels:true,
                newObj:{},
                stId:'',
                piaoName:'',
                expandArr:[],
                expandArr1:[],
                expandData:[],
                expandData1:[],
                expandData2:[],
                expandModel:{},
                expandModel1:{},
                expandModel2:{},
                expandOption:{
                    dicData:DIC,
                    column: [
                        {
                            label: "站点名",
                            prop: "zhanName",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "上限价",
                            prop: "max_price",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "运输企业定价",
                            prop: "transport_company_price",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "附加费",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "启用",
                            prop: "qiYOrN",
                            type: "select",
                            span:24,
                            size:'mini',
                            dicData: 'qiYong',
                            labelWidth:100,
                        },
                    ]
                },
                expandOption1:{
                    dicData:DIC,
                    column: [
                        {
                            label: "站点名",
                            prop: "zhanName",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "上限价",
                            prop: "max_price",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "运输企业定价",
                            prop: "transport_company_price",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "附加费",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "启用",
                            prop: "qiYOrN",
                            type: "select",
                            span:24,
                            size:'mini',
                            dicData: 'qiYong',
                            labelWidth:100,
                        },
                    ]
                },
                expandOption2:{
                    column: [
                        {
                            label: "全票",
                            prop: "quanpiao",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "半票",
                            prop: "max_price",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "学生票",
                            prop: "transport_company_price",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "老人票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "军残票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "回程票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "双程票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "员工票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "优惠票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "内部票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "春运票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                        {
                            label: "景点票",
                            prop: "surcharges",
                            span:24,
                            size:'mini',
                            labelWidth:100,
                        },
                    ]
                },
                tableData: [],
                tableData5: [],
                seatMess:true,
                hideSeatMess:false,
                newSeatNo:'',
                activeTag: "1-2",
                classDate: new Date,
                currentRow: "",
                currentMsg: {},
                road: "",
                toPlace: "",
                dateFrom: "",
                dateTo: "",
                checkChoose: 1,
                jiaBanWt: {width: "100px"},
                chooseValue: "",
                chooseItem: [
                    {
                        "label":"否",
                        "value":"0",
                    },
                    {
                        "label":"是",
                        "value":"1",
                    },
                ],
                classNum: "",
                addWin: false,
                addFunTab: "msg",
                addClassDate: "",
                addClassDateTo: "",
                addRoad: "",
                addClassNum: "",
                addCarTime: "",
                addSeatCount: "",
                addCarId: "",
                addComp: "",
                addCarType: "",
                carList: [],
                addCompII: "",
                addCompList: [],
                addSeatType: "",
                seatTypeList: [],
                ClassType: "",
                classTypeList: [],
                beforeSell: "",
                checkDoor: "",
                endStation: "",
                startPlace: "",
                beiZhu: "",
                checkStart: false,
                checkPei: false,
                checkAllow: false,
                checkAddClass: false,
                checkCarTime: false,
                checkPintSeat: false,
                checkClassNum: false,
                tWin: false,
                peiKeSta: "",
                peiKeList: [],
                updateList: {
                    "busPlan.seat_layout": "硬座",
                    "busPlan.id": "123",
                    new_bus_date_start: "222",
                    new_bus_date_end: "333",
                    "busPlan.line_id": "3333",
                    lineName: "guangzhou",
                    "busPlan.bus_id": "998",
                    "busPlan.bus_time": "2018-1-1",
                    "busPlan.all_seat": "98",
                    "busPlan.type": "icic",
                    "busPlan.seat_type": "popo",
                    "busPlan.status_id": "mii",
                    "busPlan.presell_day": "4"
                },
                // pageSize: 1,
                // pageNum: 1,
                // totalPage: 0,
                carTable: [
                    {
                        page: {
                            pageSizes: [10],
                            total: 2,
                            currentPage: 1,
                            pageSize: 10
                        },
                        data: [],
                        option: {
                            page: true,
                            stripe: true,
                            menu: false,
                            expand: true,
                            align: "center",
                            menuAlign: "center",
                            highlightCurrentRow: true,
                            column: []
                        }
                    }
                ],
                roadList: [],
                roadList1: [],
                roadList2: [],
                arr: [],
                endList: [],
                checkRoadID: "",
                checkEndID: "",
                modList: {
                    data: [],
                    option: {
                        highlightCurrentRow: true,
                        menu: false,
                        page: false,
                        align: 'center',
                        menuAlign: 'center',
                        column: [
                            {
                                label: "站点名",
                                prop: "st_name"
                            },
                            {
                                label: "全票",
                                prop: "type_1"
                            },
                            {
                                label: "半票",
                                prop: "type_2"
                            },
                            {
                                label: "上限价",
                                prop: "max_price"
                            },
                            {
                                label: "附加费",
                                prop: "surcharges"
                            },
                        ]
                    }
                },
                modCurrentRow: "",
                modTitle: "",
                peiKeMsg: [],
                seatShow: false,
                accountData:[],
                endSeat:'',
                accountOption:{
                    menu: false,
                    index:true,
                    column: [
                        {
                            label: "状态",
                            prop: "status_cn"
                        },
                        {
                            label: "工号",
                            prop: "update_userno"
                        },
                        {
                            label: "操作时间",
                            prop: "update_time"
                        },
                        {
                            label: "票号",
                            prop: "billno"
                        },
                        {
                            label: "票型",
                            prop: "tks_type"
                        },
                        {
                            label: "购票渠道",
                            prop: "create_channel_type"
                        },
                        {
                            label: "订单时间",
                            prop: "order_time"
                        },
                        {
                            label: "订单号",
                            prop: "order_no"
                        },
                        {
                            label: "取票人姓名",
                            prop: "tk_holder_name"
                        },
                        {
                            label: "手机号",
                            prop: "tk_holder_phone"
                        },
                        {
                            label: "订单状态",
                            prop: "lw_tk_prn_status"
                        },
                        {
                            label: "目的地",
                            prop: "dest_node"
                        },
                        {
                            label: "备注",
                            prop: "lw_remark"
                        },
                        {
                            label: "乘车站",
                            prop: "wait_station_name"
                        },
                        {
                            label: "已检",
                            prop: "checked"
                        },
                        {
                            label: "检票工号",
                            prop: "check_userno"
                        },
                        {
                            label: "检票时间",
                            prop: "check_time"
                        },
                    ]
                },
                rightLineName: "请选择班次",
                rightStartWin: false,
                rStart: {},
                rStartForm: {
                    dicData: DIC,
                    column: [
                        {
                            label: "开班方式",
                            prop: "openType",
                            dicData: 'openType',
                            type: "select",
                            span: 18
                        },
                        {
                            label: "开始日期",
                            prop: "startDate",
                            span: 18,
                            type: "date"
                        },
                        {
                            label: "结束日期",
                            prop: "endDate",
                            span: 18,
                            type: "date"
                        },
                        {
                            label: "同步设置",
                            prop: "tongBu",
                            type: "checkbox",
                            dicData: 'tongBuSetting',
                            span: 9,
                        },
                    ]
                },
                rightStopWin: false,
                rStop: {},
                rStopForm: {
                    dicData: DIC,
                    column: [
                        {
                            label: "长停",
                            prop: "longStop",
                            dicData: "longS",
                            type: "checkbox",
                            span: 24
                        },
                        {
                            label: "开始日期",
                            prop: "beginDate",
                            type: "date",
                            span: 12
                        },
                        {
                            label: "结束日期",
                            prop: "endDate",
                            type: "date",
                            span: 12
                        },
                        {
                            label: "同步设置",
                            prop: "tongbuSet",
                            dicData: "TongS",
                            type: "checkbox",
                            span: 24
                        },
                        {
                            label: "停班原因",
                            prop: "stopRea",
                            span: 20
                        },
                    ]
                },
                rightSumWin: false,
                rightSumMsg: {},
                sumList: {
                    data: [],
                    option: {
                        menu: false,
                        index: true,
                        page: false,
                        highlightCurrentRow: true,
                        column: [
                            {
                                label: "班次号",
                                prop: "id"
                            },
                            {
                                label: "时间",
                                prop: "bus_date"
                            },
                            {
                                label: "余座",
                                prop: "cansalecount"
                            },
                        ]
                    }
                },
                sumID: "",
                sumDate: "",
                sumMsg: {},
                sumBei: {},
                sumBeiOption: {
                    menu: false,
                    column: [
                        {
                            label: "备注",
                            prop: "beizhu",
                            span: 24
                        }
                    ]
                },
                rightCopywin1: false,
                copyCheck: false,
                copyCheck2: false,
                rightCopywin2: false,
                rightCopyAll: false,
                copyForm: {},
                copyListOption: {
                    column: [
                        {
                            label: "班次日期",
                            prop: "BanCidate",
                            type: "daterange",
                            span: 10
                        },
                        {
                            label: "班次号",
                            prop: "BCNum",
                            span: 5
                        },
                    ]
                },
                copyList: {
                    data: [],
                    option: {
                        menu: false,
                        index: true,
                        selection: true,
                        page: false,
                        column: [
                            {
                                label: "班次号",
                                prop: "bus_id"
                            },
                            {
                                label: "班次日期",
                                prop: "bus_date"
                            },
                            {
                                label: "发班时间",
                                prop: "bus_time"
                            },
                            {
                                label: "班次类型",
                                prop: "type"
                            },
                            {
                                label: "状态",
                                prop: "status_id"
                            },
                            {
                                label: "总座数",
                                prop: "all_seat"
                            },
                        ]
                    }
                },
                copyCheck: {},
                copyCheckListOption: {
                    dicData: DIC,
                    column: [
                        {
                            label: "",
                            prop: "ccl1",
                            span: 24,
                            type: "checkbox",
                            dicData: 'copyCheckList1',
                        },
                        {
                            label: "",
                            prop: "ccl2",
                            span: 24,
                            type: "checkbox",
                            dicData: 'copyCheckList2',
                        },
                    ]
                }
            };
        },
        methods: {
            // 全部列表请求
            allList() {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    page: this.carTable[0].page.currentPage,
                    rows: this.carTable[0].page.pageSize
                }).then(data => {
                    console.log(data);
                    this.carTable[0].page.total = data.data.totalRow;
                    var tag = data.data.list;

                    this.carTable[0].data = tag;
                });
            },
            currentChange(val) {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    page: val,
                    rows: this.carTable[0].page.pageSize
                }).then(data => {
                    console.log(data);
                    this.carTable[0].page.total = data.data.totalRow;
                    this.carTable[0].data = data.data.list;
                });
            },
            rowChange(val) {
                console.log(val);
                /*点击数据右侧边栏展开*/
                this.newSeatNo = val.all_seat;
                this.endSeat = val.end_seat;


                $(".seatWid").css('width','82%');
                this.seatMess = false;
                this.hideSeatMess = true;
                $(".seatMess-box>ul").html('');
                if(this.newSeatNo >0){
                    for(var k = 0;k<this.newSeatNo;k++){
                        var str = '<li>'+(k+1)+'</li>';
                        $(".seatMess-box>ul").append(str);
                    }
                }else{
                    for(var t = 0;t<this.newSeatNo;t++){
                        var ting = '<li>'+(t+1)+'&nbsp;&nbsp;&nbsp;&nbsp;停售</li>';
                        $(".seatMess-box>ul").append(ting);
                    }
                }

                /*点击数据右侧边栏展开*/

                this.currentRow = val.id;
                this.currentMsg = val;
                this.currentMsg.line_name = val.line_name;
                this.currentMsg.bus_id = val.bus_id;
                this.currentMsg.bus_date = val.bus_date;
                this.currentMsg.end_seat = val.end_seat;
                this.currentMsg.status_id = val.status_id;
                this.currentMsg.vehi_no = val.vehi_no;
                this.currentMsg.checkdoor = val.checkdoor;
                this.currentMsg.kawei = val.kawei;
                // 配客弹窗数据
                this.getRequest("/sch/bus/plan/getViaStation?bus_plan_id=" + val.id).then(data => {
                    this.peiKeMsg = [];
                    for (var item of data.data) {
                        this.peiKeMsg.push({
                            idx: item.idx,
                            org_name: item.org_name,
                            bus_id: item.bus_id,
                            bus_time: item.bus_time
                        });
                    }
                });
                this.rightLineName = val.line_name;
            },
            check() {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    filterRules: JSON.stringify([
                        {
                            field: "bus_plan.bus_date",
                            op: 'eq',
                            value: that.classDate == "" ? that.dateToString(new Date) : that.dateToString(that.classDate)
                        },
                        {field: "bus_plan.line_id", op: "eq", value: that.checkRoadID},
                        {field: "bus_plan_price.st_id", op: "eq", value: that.checkEndID},
                        {
                            field: "bus_plan.bus_id",
                            op: 'eq',
                            value: that.classNum
                        }
                    ]),
                    page: "1",
                    rows: "10"
                }).then(data => {
                    this.carTable[0].data = data.data.list;
                })
            },
            // 售票
            sell() {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    filterRules: JSON.stringify([
                        {"field":"bus_plan.bus_date","op":"eq","value":this.dateToString(this.classDate)?this.dateToString(this.classDate):this.dateToString(new Date)},
                        {field: "bus_plan.status_id", op: "eq", value: "1"}
                    ]),
                    page: this.carTable[0].page.currentPage,
                    rows: 10,
                    sort: 'bus_time,bus_id',
                    order: 'asc,asc'
                }).then(data => {
                    console.log(this.carTable[0].page.total);
                    console.log(data.data.totalRow);
                    this.carTable[0].data = data.data.list;
                    this.carTable[0].page.total = data.data.totalRow;
                })
            },
            // 报班
            upClass() {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    filterRules: JSON.stringify([
                        {"field":"bus_plan.bus_date","op":"eq","value":this.dateToString(this.classDate)?this.dateToString(this.classDate):this.dateToString(new Date)},
                        {field: "bus_plan.status_id", op: "eq", value: "3"},
                    ]),
                    page: this.carTable[0].page.currentPage,
                    rows: 10,
                    sort: 'bus_time,bus_id',
                    order: 'asc,asc'
                }).then(data => {
                    this.carTable[0].data = data.data.list;
                    this.carTable[0].page.total = data.data.totalRow;
                })
            },
            // 停班
            stopClass() {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    filterRules: JSON.stringify([
                        {"field":"bus_plan.bus_date","op":"eq","value":this.dateToString(this.classDate)?this.dateToString(this.classDate):this.dateToString(new Date)},
                        {field: "bus_plan.status_id", op: "eq", value: "2"}
                    ]),
                    page: this.carTable[0].page.currentPage,
                    rows: 10,
                    sort: 'bus_time,bus_id',
                    order: 'asc,asc'
                }).then(data => {
                    this.carTable[0].data = data.data.list;
                    this.carTable[0].page.total = data.data.totalRow;
                })
            },
            // 发班
            sendClass() {
                var that = this;
                that.carTable[0].data = [];
                this.postRequest("/sch/bus/plan/list", {
                    filterRules: JSON.stringify([
                        {"field":"bus_plan.bus_date","op":"eq","value":this.dateToString(this.classDate)?this.dateToString(this.classDate):this.dateToString(new Date)},
                        {field: "bus_plan.status_id", op: "eq", value: "4"}
                    ]),
                    page: this.carTable[0].page.currentPage,
                    rows: 10,
                    sort: 'bus_time,bus_id',
                    order: 'asc,asc'
                }).then(data => {
                    this.carTable[0].data = data.data.list;
                    this.carTable[0].page.total = data.data.totalRow;
                })
            },
            tableCreate() {
                this.carTable[0].option.column.push(
                    {
                        label: "线路",
                        prop: "line_name"
                    },
                    {
                        sortable:true,
                        label: "班次号",
                        prop: "bus_id"
                    },
                    {
                        sortable:true,
                        label: "时间",
                        prop: "bus_time"
                    },
                    {
                        label: "类型",
                        prop: "type"
                    },
                    {
                        label: "状态",
                        prop: "status_id",
                        formatter: function (row, value, label, column) {
                            if (row.status_id == 1) {
                                return '售票';
                            }else if(row.status_id == 2){
                                return '停班';
                            }else if(row.status_id == 3){
                                return '报班';
                            } else {
                                return '发班';
                            }
                        }
                    },
                    {
                        label: "计划车牌",
                        prop: "vehi_no"
                    },
                    {
                        label: "报班车牌",
                        prop: "baoban_vehi_no"
                    },
                    {
                        label: "可售",
                        prop: "cansalecount"
                    },
                    {
                        label: "共售",
                        prop: "salecount",
                        formatter: function (row, value, label, column) {
                            if (row.salecount == 0) {
                                return 0
                            } else {
                                return row.salecount
                            }
                        }
                    },
                    {
                        label: "本站",
                        prop: "salecount_owner_org",
                        formatter: function (row, value, label, column) {
                            if (row.salecount_owner_org == 0) {
                                return 0
                            } else {
                                return row.salecount_owner_org
                            }
                        }
                    },
                    {
                        label: "余座",
                        prop: "end_seat",
                        formatter: function (row, value, label, column) {
                            if (row.end_seat == 0) {
                                return 0
                            } else {
                                return row.end_seat
                            }
                        }
                    },
                    {
                        label: "检票口",
                        prop: "checkdoor",
                        formatter: function (row, value, label, column) {
                            if (row.checkdoor == 'null') {
                                return 0
                            }
                        }
                    },
                    {
                        label: "卡位",
                        prop: "kawei",
                        formatter: function (row, value, label, column) {
                            if (row.kawei == 'null') {
                                return 0
                            }
                        }
                    },
                    {
                        label: "座位类型",
                        prop: "planed_driver_1"
                    },
                    {
                        label: "运营单位",
                        prop: "customer_name"
                    },
                    {
                        label: "备注",
                        prop: "remark"
                    },
                );
            },
            reset() {
                this.classDate = "";
                this.road = "";
                this.toPlace = "";
                this.dateFrom = "";
                this.dateTo = "";
                this.chooseValue = "";
                this.classNum = "";
                this.carTable[0].data = [];
                this.allList();
            },
            // 弹窗
            addClass() {
                this.addWin = true;
                this.modTitle = "添加班次"
                this.getSeatTypeList();
                this.getClassTypeList();
                this.getAddCompList();
                this.getChooseItem();
                this.getModList();
                this.getCarList();
            },
            redClass() {
                this.addWin = false;
                this.addRoad = "";
                this.addClassNum = "";
                this.addCarTime = "";
                this.addSeatCount = "";
                this.addCarId = "";
                this.startPlace = "";
                this.addFunTab = "msg";
                this.tableData5 = [];
            },
            saveClass() {
                this.postRequest("/sch/bus/plan/add",
                        {
                            "busPlan.seat_layout": this.addSeatType,
                            "busPlan.id": this.addClassNum,
                            'new_bus_date_start': this.dateToString(this.addClassDate) ,
                            'new_bus_date_end': this.dateToString(this.addClassDateTo), 
                            "busPlan.line_id": this.addRoad,
                            'lineName': this.addRoad,
                            "busPlan.bus_id": this.addClassNum,
                            "busPlan.bus_time": this.dateToString(this.addCarTime),
                            "busPlan.all_seat": this.addSeatCount,
                            "busPlan.type": this.addCompII,
                            "busPlan.seat_type": this.addSeatType,
                            "busPlan.status_id": this.ClassType,
                            "busPlan.presell_day": this.beforeSell,
                        }
                    )
                    .then(data => {
                        // console.log(data);
                        if (data.data[0] == 0) {
                            this.$message({
                                message: data.data[1],
                                type: "success"
                            });
                            this.getTicketList();
                        } else {
                            this.$message.error("信息有误或缺失请检查!");
                        }
                    });
            },
            deleteClass() {
                this.postRequest("/sch/bus/plan/del?id=" + this.currentRow)
                    .then(data => {
                        console.log(data);
                        if (data.data[0] == -1) {
                            this.$message.error("删除失败！");
                        } else {
                            this.$message({
                                message: data.data[1],
                                type: "success"
                            });
                        }
                    });
            },
            showUpdateWin() {
                this.modTitle = "修改班次";
                if (this.currentRow == "") {
                    this.$message.error('请选择一条记录');
                } else {
                    this.addWin = true;
                    this.addRoad = this.currentMsg.line_name;
                    this.addClassNum = this.currentMsg.status_id;
                    this.addCarTime = this.currentMsg.bus_date;
                    this.addSeatCount = this.currentMsg.end_seat;
                    this.addCarId = this.currentMsg.vehi_no;
                    this.startPlace = this.currentMsg.kawei;
                    this.addComp=this.currentMsg.customer_name;
                    this.addCarType="",
                    this.addSeatType=this.currentMsg.seat_type;
                    this.beforeSell=this.currentMsg.presell_day;
                    this.checkDoor=this.currentMsg.checkdoor;
                    this.endStation=this.currentMsg.end_station;
                    this.beiZhu=this.currentMsg.remark;
                    this.checkAddClass=this.currentMsg.is_ot;
                    this.checkAllow=this.currentMsg.is_remote_sell;
                    this.checkPei=this.currentMsg.is_mix;
                    this.checkStart=this.currentMsg.is_valid;
                }
            },
            TicTableMsg() {
                this.modTitle = "修改班次";
                if (this.currentRow == "") {
                    this.$message.error('请选择一条记录');
                } else {
                    this.addWin = true;
                    this.addRoad = this.currentMsg.line_name;
                    this.addClassNum = this.currentMsg.status_id;
                    this.addCarTime = this.currentMsg.bus_date;
                    this.addSeatCount = this.currentMsg.end_seat;
                    this.addCarId = this.currentMsg.vehi_no;
                    this.startPlace = this.currentMsg.kawei;
                    this.addFunTab = "price";
                    this.getPriceList();
                }
            },
            getPriceList(){
                /*票价-加载添加窗口 S*/
                this.postRequest('/sch/bus/plan/price/list',
                    {
                        filterRules: JSON.stringify([
                            { "field":"bus_plan_via_station.bus_plan_id__or__bus_plan_via_station.main_bus_plan_id","op":"eq","value":this.currentRow }
                        ]),
                        'sort': 'bus_plan_via_station.is_main,bus_plan_via_station.idx,base_line_station.idx',
                        'order': 'desc,asc,asc'
                    })
                    .then(target =>{
                        console.log(target);
                        var tag = target.data.list;
                        if(tag.length >0){

                            this.tableData = '';
                            this.tableData5 = tag;


                            for(var k=0;k<this.tableData5.length;k++){
                                this.expandModel.max_price = this.tableData5[k].max_price;
                                this.expandModel.zhanName = this.tableData5[k].st_name;
                                this.expandModel.transport_company_price = this.tableData5[k].transport_company_price;
                                this.expandModel.surcharges = this.tableData5[k].surcharges;

                                // this.type_1 = this.tableData5[k].type_1;


                                if(this.tableData5[k].is_valid){
                                    this.tableData5[k].is_valid = '启用';
                                    this.expandModel.qiYOrN = true;
                                }else{
                                    this.tableData5[k].is_valid = '否';
                                    this.expandModel.qiYOrN = false;
                                }
                            }

                            this.one = this.tableData5[0];
                            console.log(this.one);

                            this.stId = target.data.list[0].st_id;
                            console.log(this.tableData5);
                        }

                    });
                /*票价-加载添加窗口 E*/

                // 票型列表
                this.postRequest("/tks/type/all")
                    .then(target =>{
                        console.log(target);
                        var tag = target.data;
                        this.expandArr = tag;
                        for (var b = 0; b <  this.expandArr.length; b++) {
                            this.$set(this.one, 'checkbox' +  this.expandArr[b].id, '');
                        }
                    });
            },
            saveExpand(){//点击添加弹窗的 保存
                if(this.expandModel1.zhanName == ''){
                    this.$message.error('请填写站点名');
                }else if(this.expandModel1.max_price == ''){
                    this.$message.error('请填写上限价');
                }else if(this.expandModel1.surcharges == ''){
                    this.$message.error('请填写附加费');
                }else if(this.expandModel2.quanpiao == ''){
                    this.$message.error('请填写全票');
                }else if(this.expandModel1.qiYOrN == ''){
                    this.$message.error('请选择启用');
                }else{
                    this.postRequest('/sch/bus/plan/price/add',{
                        'bus_seat': -1,
                        'busPlanPrice.id':'',
                        'busPlanPrice.bus_plan_id': this.currentRow,
                        'busPlanPrice.st_id': this.stId,
                        'busPlanPrice-st_name': this.expandModel1.zhanName,
                        'busPlanPrice.max_price': this.expandModel1.max_price,
                        // 'type_1': this.expandModel2.quanpiao,
                        'type_1': this.one.type_1,
                        'type_2': this.one.type_2,
                        'busPlanPrice.transport_company_price': this.expandModel1.transport_company_price,
                        'busPlanPrice.surcharges': this.expandModel1.surcharges,
                        'busPlanPrice.is_valid': this.expandModel1.qiYOrN,
                    })
                        .then(target =>{
                            console.log(target);
                            var tag = target.data[0];
                            if(tag === '-1'){
                                this.$message.error(target.data[1]);
                            }else{
                                this.$message.error(target.data[1]);
                                this.expandModel1.zhanName = '';
                                this.expandModel1.max_price = '';
                                this.expandModel2.quanpiao = '';
                                this.expandModel1.transport_company_price = '';
                                this.expandModel1.surcharges = '';
                                this.expandModel1.qiYOrN = '';
                                this.addModels = false;
                            }
                        });
                }
            },
            saveData(){//点击修改弹窗的 保存
                // console.log(this.one);
                if(this.expandModel.zhanName === ''){
                    this.$message.error('请填写站点名');
                }else if(this.expandModel.max_price === ''){
                    this.$message.error('请填写上限价');
                }else if(this.expandModel.surcharges === ''){
                    this.$message.error('请填写附加费');
                }else if(this.expandModel2.quanpiao === ''){
                    this.$message.error('请填写全票');
                }else if(this.expandModel.qiYOrN === ''){
                    this.$message.error('请选择启用');
                }else{
                    this.postRequest('/sch/bus/plan/price/add',{
                        'bus_seat': -1,
                        'busPlanPrice.id':'',
                        'busPlanPrice.bus_plan_id': this.currentRow,
                        'busPlanPrice.st_id': this.stId,
                        'busPlanPrice-st_name': this.expandModel.zhanName,
                        'busPlanPrice.max_price': this.expandModel.max_price,
                        'type_1': this.one.type_1,
                        'type_2': this.one.type_2,
                        'busPlanPrice.transport_company_price': this.expandModel.transport_company_price ? this.expandModel.transport_company_price : '',
                        'busPlanPrice.surcharges': this.expandModel.surcharges,
                        'busPlanPrice.is_valid': this.expandModel.qiYOrN,
                    })
                        .then(target =>{
                            console.log(target);
                            var tag = target.data[0];
                            if(tag === '-1'){
                                this.$message.error(target.data[1]);
                            }else{
                                this.$message.error(target.data[1]);
                            }
                        });
                }
            },
            cancleExpand(){//点击添加弹窗的 取消
                this.addModels = false;
            },
            handleClick(tab, event) {
                console.log(tab, event);
                if(tab.label === '票价'){
                    this.getPriceList();
                }
            },
            peiKeTableMsg() {
                this.modTitle = "修改班次";
                if (this.currentRow == "") {
                    this.$message.error('请选择一条记录');
                } else {
                    this.addWin = true;
                    this.addRoad = this.currentMsg.line_name;
                    this.addClassNum = this.currentMsg.status_id;
                    this.addCarTime = this.currentMsg.bus_date;
                    this.addSeatCount = this.currentMsg.end_seat;
                    this.addCarId = this.currentMsg.vehi_no;
                    this.startPlace = this.currentMsg.kawei;
                    this.addFunTab = "seat";
                }
            },
            copyClass(row) {
                console.log(row);
                this.modTitle = "复制班次";
                // if (this.currentRow == "") {
                //     this.$message.error('请选择一条记录');
                // } else {
                    this.addWin = true;
                    this.addRoad = row.line_name;
                    this.addClassNum = row.status_id;
                    this.addCarTime = row.bus_date;
                    this.addSeatCount = row.end_seat;
                    this.addCarId = row.vehi_no;
                    this.startPlace = row.kawei;
                    this.addComp=row.customer_name;
                    this.addCarType="",
                    this.addSeatType=row.seat_type;
                    this.beforeSell=row.presell_day;
                    this.checkDoor=row.checkdoor;
                    this.endStation=row.end_station;
                    this.beiZhu=row.remark;
                    this.checkAddClass=row.is_ot;
                    this.checkAllow=row.is_remote_sell;
                    this.checkPei=row.is_mix;
                    this.checkStart=row.is_valid;
                // }
            },
            update() {
                this.postRequest(
                        "/sch/bus/plan/update",
                        qs.stringify(this.updateList)
                    )
                    .then(data => {
                        if (data.data[0] == 0) {
                            this.$message({
                                message: data.data[1],
                                type: "success"
                            });
                        } else {
                            this.$message.error(data.data[1]);
                        }
                    });
            },
            handleCurrentChange(val) {
                this.postRequest(
                    "/sch/bus/plan/list",
                    qs.stringify({page: val})
                )
                    .then(data => {
                        var that = this;
                        for (var c of data.data.list) {
                            that.carTable.push({
                                line_name: c.line_name,
                                bus_id: c.bus_id,
                                bus_date: c.bus_date,
                                status_id: c.status_id,
                                customer_name: c.customer_name,
                                id: c.id,
                                bus_time: c.bus_time,
                                cansalecount: c.cansalecount,
                                salecount: c.salecount,
                                salecount_owner_org: c.salecount_owner_org,
                                end_seat: c.end_seat,
                                checkdoor: c.checkdoor,
                                kawei: c.kawei
                            });
                        }
                    });
            },
            loadRoad() {
                this.postRequest("/sch/data/line/listWithSpell").then(data => {
                    console.log(data);
                    for (var item of data.data) {
                        this.roadList.push({
                            value: item.name,
                            id: item.id
                        });
                        this.roadList1.push({
                            value: item.name,
                            id: item.id
                        });
                    }
                });
            },
            loadBusVehicle() {
                this.postRequest("/sch/data/bus_vehicle/listWithSpell").then(data => {
                    console.log(data);
                    for (var item of data.data) {
                        this.roadList2.push({
                            value: item.vehi_no,
                        });
                    }
                });
            },
            loadComp() {
                this.postRequest("/sch/data/bus_company/listWithSpell").then(data => {
                    for (var c of data.data) {
                        this.arr.push({ value: c.name, prop: c.id });
                    }
                });
            },
            loadEnd() {
                this.postRequest("/sch/data/station/listWithSpell").then(data => {
                    for (var item of data.data) {
                        this.endList.push({
                            value: item.name,
                            id: item.id
                        });
                    }
                });
            },
            querySearch(queryString, cb) {
                var roadlist = this.roadList;
                var results = queryString ? roadlist.filter(this.createFilter(queryString)) : roadlist;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            querySearch1(queryString, cb) {
                var roadlist1 = this.roadList1;
                var results = queryString ? roadlist1.filter(this.createFilter(queryString)) : roadlist1;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            querySearch2(queryString, cb) {
                var roadlist1 = this.roadList2;
                var results = queryString ? roadlist1.filter(this.createFilter(queryString)) : roadlist1;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            querySearch3(queryString, cb) {
                var roadlist1 = this.arr;
                var results = queryString ? roadlist1.filter(this.createFilter(queryString)) : roadlist1;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            createFilter(queryString) {
                return (roadlist) => {
                    return (roadlist.value);
                }
            },
            querySearchEnd(queryString, cb) {
                var endlist = this.endList;
                var results = queryString ? endlist.filter(this.createFilter(queryString)) : endlist;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            getSeatTypeList() {
                this.seatTypeList = [];
                this.postRequest("/sch/data/common/busseattype").then(data => {
                    for (var item of data.data) {
                        this.seatTypeList.push({
                            value: item.value,
                            label: item.key
                        });
                    }
                })
            },
            getClassTypeList() {
                this.classTypeList = [];
                this.postRequest("/sch/data/common/busstatus").then(data => {
                    for (var item of data.data) {
                        this.classTypeList.push({
                            value: item.key,
                            label: item.value
                        });
                    }
                });
            },
            getAddCompList() {
                this.addCompList = [];
                this.postRequest("/sch/data/common/bustype").then(data => {
                    for (var item of data.data) {
                        this.addCompList.push({
                            value: item.value,
                            label: item.key
                        });
                    }
                });
            },
            getChooseItem() {
                this.postRequest("/common/constant/getYesOrNo").then(data => {
                    for (var item of data.data) {
                        this.chooseItem.push({
                            value: item.value,
                            label: item.key
                        });
                    }
                })
            },
            getModList() {
                this.postRequest("/sch/bus/plan/price/list").then(data => {
                    for (var item of data.data.list) {
                        this.modList.data.push({
                            st_name: item.st_name,
                            type_1: item.type_1,
                            type_2: item.type_2,
                            max_price: item.max_price,
                            surcharges: item.surcharges
                        });
                    }
                })
            },
            getCarList() {
                this.carList = [];
                this.postRequest("/sch/const/bus_vehicle_type/listWithSpell").then(data => {
                    for (var item of data.data) {
                        this.carList.push({
                            value: item.id,
                            label: item.name
                        });
                    }
                })
            },
            TicAdd() {
               /* this.postRequest("/sch/bus/plan/price/detail?_=1535273667272").then(data => {
                    console.log(data);
                });*/
               this.addModels = true;
            },
            TicDel() {
                if (this.currentRow != "") {
                    this.getRequest("/sch/bus/plan/price/del?id=" + this.modCurrentRow).then(data => {
                        if (data.data[0] == "0") {
                            this.$message({
                                message: data.data[1],
                                type: 'success'
                            });
                            this.modCurrentRow = "";
                        } else {
                            this.$message.error(data.data[1]);
                        }
                    })
                } else {
                    this.$message.error("请选择一条记录");
                }
            },
            TicUpdate() {
                this.getRequest("/sch/bus/plan/price/copyToSameLine?bus_plan_id=" + this.currentRow + "&to_all_days=false&keep_status=1").then(data => {
                    if (data.data[0] == "0") {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.modCurrentRow = "";
                    } else {
                        this.$message.error("更新失败！请检查");
                    }
                });
            },
            TicTongbu() {
                this.getRequest("/sch/bus/plan/copyViaStationSyncConfig?bus_plan_id=" + this.currentRow + "&all_days=0").then(data => {
                    if (data.data[0] == "0") {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.modCurrentRow = "";
                        this.addWin=false;
                    } else {
                        this.$message.error("更新失败！请检查");
                    }
                })
            },
            getSeatDetailList() {
                var that = this;
                this.accountData = [];
                this.postRequest("/sch/bus/plan/seat/list",
                    {
                        'bus_plan_id': this.currentRow,
                        'show_del': '0',
                        'show_sale_only': '0'
                    }).then(data => {
                        console.log(data);
                        var tag = data.data;
                        that.accountData = tag;
                });
            },
            redSeat() {
                this.seatShow = false;
            },
            showSeatDetail() {
                if(this.currentRow == ''){
                    this.$message.error('请选择一条数据再点击');
                }else{
                    this.seatShow = true;
                    this.getSeatDetailList();
                }
            },
            tablerowChange() {
            },
            modrowChange(val) {
                this.modCurrentRow = val.id;
            },
            addPei(){
                console.log(this.peiKeSta);
                this.peiKeMsg.push({
                    org_name:this.peiKeSta,
                    bus_time:this.peiKeMsg[0].bus_time,
                    bus_id:this.peiKeMsg[0].bus_id
                })
            },
            saveSta(){
                this.postRequest("/sch/bus/plan/saveViaStation",{
                    id:this.currentMsg.id,
                    bus_plan_id:this.currentMsg.bus_define_id,
                    main_bus_plan_id:this.currentMsg.bus_id,
                    org_id:this.currentMsg.owner_org,
                }).then(data=>{
                    this.msgShow(data);
                    this.addWin=false;
                })
            },
            // 右键弹窗
            openRightStart() {
                this.rightStartWin = true;
            },
            closeRight() {
                this.rightStartWin = false;
            },
            desClass() {
                this.getRequest("/sch/bus/plan/doXiaoban?bus_plan_id=" + this.currentRow).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                    } else {
                        this.$message.error(data.data[1]);
                    }
                })
            },
            rStartClass() {
                this.postRequest("/sch/bus/plan/doKaiban", {
                    kaiban_type: this.rStart.openType,
                    start_date: this.rStart.startDate ? this.dateToString(this.rStart.startDate) : "",
                    end_date: this.rStart.endDate ? this.dateToString(this.rStart.endDate) : "",
                    synchro: this.rStart.tongbu ? this.rStart.tongbu : "",
                    bus_plan_id: this.currentRow
                }).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.closeRight();
                    } else {
                        this.$message.error(data.data[1]);
                    }
                })
            },
            openRightStop() {
                this.rightStopWin = true;
            },
            closeStop() {
                this.rightStopWin = false;
            },
            rStopClass() {
                console.log(this.rStop);
                this.getRequest("/sch/bus/plan/doTingban?stop_type=" + this.rStop.longStop + "&start_date=" + this.dateToString(this.rStop.beginDate) + "&end_date=" + this.dateToString(this.rStop.endDate) + "&synchro=" + this.rStop.tongbuSet + "&reason=" + this.rStop.stopRea + "&bus_plan_id=" + this.currentRow).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.closeStop();
                    } else {
                        this.$message.error(data.data[1]);
                    }
                })
            },
            openRightSum() {
                this.rightSumWin = true;
                this.getSumList();
            },
            closeSum() {
                this.rightSumWin = false;
            },
            getSumList() {
                this.postRequest("/sch/bus/plan/list").then(data => {
                    this.sumList.data = data.data.list
                })
            },
            rSum() {
                console.log(this.currentMsg.id)
                this.postRequest("/sch/bus/plan/doBingban", {
                    _from: this.currentMsg.id,
                    _to: this.sumID,
                    remark: this.sumBei.beizhu ? this.sumBei.beizhu : "无"
                }).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.closeSum();
                    } else {
                        this.$message.error(data.data[1]);
                    }
                });
            },
            rSumCurrentRow(val) {
                this.sumID = val.id;
                this.sumDate = val.bus_date;
                this.sumMsg = val;
                console.log(val)
            },
            openCopy1() {
                this.rightCopywin1 = true;
            },
            copyConfirm() {
                this.getRequest("/sch/bus/plan/price/copyToSameLine?bus_plan_id=" + this.currentMsg.id + "&to_all_days=false&keep_status=" + this.copyCheck).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.discopy();
                    } else {
                        this.$message.error(data.data[1]);
                    }
                })
            },
            discopy() {
                this.rightCopywin1 = false;
            },
            openCopy2() {
                this.rightCopywin2 = true;
            },
            discopy2() {
                this.rightCopywin2 = false;
            },
            copyConfirm2() {
                this.getRequest("/sch/bus/plan/price/copyToSameLine?bus_plan_id=" + this.currentMsg.id + "&to_all_days=true&keep_status=" + this.copyCheck2).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.discopy2();
                    } else {
                        this.$message.error(data.data[1]);
                    }
                })
            },
            openRightCopy() {
                this.rightCopyAll = true;
            },
            closeCopy() {
                this.rightCopyAll = false;
            },
            docopyCheck() {
                this.getcopyList();
            },
            getcopyList() {
                this.postRequest("/sch/bus/plan/copylist", {
                    bus_plan_id: this.currentRow,
                    be_busdate: this.dateToString(this.copyForm.BanCidate[0]),
                    ed_busdate: this.dateToString(this.copyForm.BanCidate[1]),
                    line_id: this.currentMsg.line_id
                }).then(data => {
                    this.copyList.data = data.data.list;
                })
            },
            closeCopyDetail() {
                this.rightCopyAll = false;
            },
            rCopyDetail() {
                this.postRequest("/sch/bus/plan/doCopybusInfo", {
                    bus_plan_id: this.currentRow,
                    // copy_seat:this.copyCheck.copyCheckList1[0]?"on":"off",
                    // copy_price:this.copyCheck.copyCheckList1[1]?"on":"off",
                    // copy_vehi_no:this.copyCheck.copyCheckList1[2]?"on":"off",
                    // copy_customer:this.copyCheck.copyCheckList1[3]?"on":"off",
                    // copy_vehi_type:this.copyCheck.copyCheckList1[4]?"on":"off",
                    // copy_status:this.copyCheck.copyCheckList1[5]?"on":"off",
                    // copy_type:this.copyCheck.copyCheckList1[6]?"on":"off",
                    // copy_presell:this.copyCheck.copyCheckList1[7]?"on":"off",
                    // copy_checkdoor:this.copyCheck.copyCheckList1[8]?"on":"off",
                    // copy_kawei:this.copyCheck.copyCheckList2[0]?"on":"off",
                    // copy_is_mix:this.copyCheck.copyCheckList2[1]?"on":"off",
                    // copy_is_valid:this.copyCheck.copyCheckList2[2]?"on":"off",
                    // copy_is_ot:this.copyCheck.copyCheckList2[3]?"on":"off",
                    // copy_is_remote:this.copyCheck.copyCheckList2[4]?"on":"off",
                    // copy_end_station:this.copyCheck.copyCheckList2[5]?"on":"off",
                    // copy_prn_time:this.copyCheck.copyCheckList2[6]?"on":"off",
                    // copy_prn_busid:this.copyCheck.copyCheckList2[7]?"on":"off",
                    // copy_prn_seat:this.copyCheck.copyCheckList2[8]?"on":"off",
                    bus_plan_ids: this.currentRow
                }).then(data => {
                    if (data.data[0] == 0) {
                        this.$message({
                            message: data.data[1],
                            type: 'success'
                        });
                        this.closeCopyDetail();
                    } else {
                        this.$message.error(data.data[1]);
                    }
                })
            },
            showSeatFun(){
                this.seatMess = false;
                this.hideSeatMess = true;
                $(".seatWid").css('width','82%');
            },
            hideSeat(){
                this.seatMess = true;
                this.hideSeatMess = false;
                $(".seatWid").css('width','98%');
            },
            getTks(){
                this.postRequest("/tks/type/all")
                    .then(target =>{
                        console.log(target);
                        var tag = target.data;
                        this.expandArr1 = tag;
                    });
            },
        },
        computed: {},
        components: {DropDown, TableData, FormData},
        watch: {
            checkChoose() {
                switch (this.checkChoose) {
                    case 1:
                        this.carTable[0].data = [];
                        this.allList();
                        break;
                    case 2:
                        this.carTable[0].data = [];
                        this.sell();
                        break;
                    case 3:
                        this.carTable[0].data = [];
                        this.upClass();
                        break;
                    case 4:
                        this.carTable[0].data = [];
                        this.stopClass();
                        break;
                    case 5:
                        this.carTable[0].data = [];
                        this.sendClass();
                        break;
                }
            },
            road() {
                if (this.road == "") {
                    this.checkRoadID = "";
                } else {
                    for (var item of this.roadList) {
                        if (this.road == item.value) {
                            this.checkRoadID = item.id
                        }
                    }
                }
            },
            toPlace() {
                if (this.toPlace == "") {
                    this.checkEndID = "";
                } else {
                    for (var item of this.endList) {
                        if (this.toPlace == item.value) {
                            this.checkEndID = item.id
                        }
                    }
                }
            },
            region(){
                console.log(this.region);
            }
        },
        mounted() {
            this.allList();
            this.getTks();
            console.log("banCiPlan");
            this.$emit("sendActive", this.activeTag);
            this.getRequest("/sch/bus/plan/getViaStation?bus_plan_id=1635464")
                .then(data => {
                    for (var item of data.data) {
                        this.peiKeList.push({label: item.org_name});
                    }
                });

            this.tableCreate();
            this.loadRoad();
            this.loadBusVehicle();
            this.loadEnd();
            this.loadComp();
            // 二级右键窗口
            $(".rightTwo,.right-menuII").hover(function () {
                $(".right-menuII").show();
            }, function () {
                $(".right-menuII").hide();
            });
        }
    };
</script>
<style scoped src="../../assets/css/service/banCiPlan.css"></style>
<style scoped>

</style>

